---
title: FaceDetector
description: A library that uses Google Mobile Vision to detect faces on images.
sourceCodeUrl: 'https://github.com/expo/expo/tree/sdk-50/packages/expo-face-detector'
packageName: 'expo-face-detector'
---

import APISection from '~/components/plugins/APISection';
import { APIInstallSection } from '~/components/plugins/InstallSection';
import PlatformsSection from '~/components/plugins/PlatformsSection';
import { SnackInline } from '~/ui/components/Snippet';
import { PlatformTags } from '~/ui/components/Tag';

> **warning** **Deprecated:** This library will no longer be available from SDK 51. We recommend [`react-native-vision-camera`](https://github.com/mrousavy/react-native-vision-camera) if you require this functionality.

`expo-face-detector` lets you use the power of the [Google's ML Kit](https://developers.google.com/ml-kit/vision/face-detection) framework to detect faces on images.

<PlatformsSection android ios />

#### Known issues&ensp;<PlatformTags platforms={['android']} />

Face detector does not recognize faces that aren't aligned with the interface (top of the interface matches top of the head).

## Installation

This module is **not** available in the [Expo Go app](https://expo.dev/go) because it has dependencies that break builds for iOS Simulators.

You can create a [development build](/develop/development-builds/create-a-build/) to work with this package.

<APIInstallSection />

## Usage

### Settings

To configure detector's behavior modules pass a [`DetectionOptions`](#detectionoptions) object which is then interpreted by this module.

### Example

You can use the following snippet to detect faces in a fast mode without detecting landmarks or whether a face is smiling.

<SnackInline dependencies={['expo-camera', 'expo-face-detector']} label="Quick face detection">

```jsx
import * as React from 'react';
import { Camera } from 'expo-camera';
import * as FaceDetector from 'expo-face-detector';

const App = () => (
  <Camera
    // other props
    onFacesDetected={handleFacesDetected}
    faceDetectorSettings={{
      mode: FaceDetector.FaceDetectorMode.fast,
      detectLandmarks: FaceDetector.FaceDetectorLandmarks.none,
      runClassifications: FaceDetector.FaceDetectorClassifications.none,
      minDetectionInterval: 100,
      tracking: true,
    }}
  />
);

const handleFacesDetected = ({ faces }) => {
  console.log(faces);
};

export default App;
```

</SnackInline>

## API

```js
import * as FaceDetector from 'expo-face-detector';
```

<APISection packageName="expo-face-detector" apiName="FaceDetector" />
